home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
COMMUNIC
/
COMMUTIL
/
2258.ZIP
/
ONCEADAY.ZIP
/
ONCEADAY.DOC
next >
Wrap
Text File
|
1989-12-20
|
5KB
|
119 lines
ONCEADAY.EXE V1.00
------------------
Batch File Utility
20th December 1989
Disclaimer
----------
This program is being put into the Public Domain and may be freely
distributed on the understanding that no responsibility can be
accepted for any problems arising from its use. To the best of our
knowledge, it is 'Bug free' and serves its intended purpose.
No charge, other than a nominal charge for duplication and postage may
be made for it and it should only be supplied as a single ARC or ZIP
file called ONCEADAY.ARC, or ONCEADAY.ZIP, containing the ONCEADAY.EXE
and ONCEADAY.DOC files.
Overview
--------
OnceADay is a very simple program with one object. Every time it is
run, it returns an errorcode to the batch file from which it was
called. If the program has already been exectuted in the curent day,
it returns an errorlevel of 1, otherwise, an errorlevel of 0.
This provides a simple mechanism for determining whether a part of the
batch file is to be executed or not, allowing you to only run certain
programs if they have not already been run that day.
The program was originally written for use with the EaziLink comms
program in Host Mode, so that certain programs would only update data
once a day instead of every time the program recycled.
OnceADay is equally useful in other circumstances, such as when you
have a program in your AUTOEXEC.BAT file which you only want to run
the first time you boot the computer each day.
Running ONCEADAY
----------------
ONCEADAY.EXE should be placed in any directory which is specified by
the PATH command.
The syntax used to run OnceADay is:-
ONCEADAY <pathname>
<pathname> may be the name of any file on any valid drive and may
include the full path and drive letter.
NOTE: The file specified by pathname may be a special file for the
purpose, or any existing file. Whenever OnceADay is run, the
time and date stamp of the file will be changed to the current
date and time of the computer's clock. You should not,
therefore, specify the name of a file if it is important that
the date of that file is not changed!
What The Program Does
---------------------
Whenever ONCEADAY is run, the current date of the specified file is
read and compared with the date according to the computer's system
clock. If the date is the same, an Errorlevel of 1 is returned. If the
dates differ, errorlevel equals 0. This enables you to check the
errorlevel in the batch file, on return from the program and to
conditionally GOTO a different part of the batch file, depending on
the result. See the example batch file below.
Irrespective of whether the date is the same or not, the specified
file's time/date stamp is updated to the system clock's current time
and date before the program terminates.
OnceADay was written to make use of a specified file rather than its
own date and time, so that it may be run from any number of different
batch files, but always compares the date and time with the specified
file. This ensures that it always returns the right answer even when
different batch files are run.
A Sample Batch File
-------------------
The following is an example of a batch file called RECYCLE.BAT which
is run every time that EaziLink's Host Mode re-cycles after a caller.
ECHO OFF
REM Run programs her if you want, every time the batch file runs.
ONCEADAY C:\EAZILINK\HOSTMAIN\RECYLE.BAT
IF ERRORLEVEL==1 GOTO END
REM Execute the remaining lines only if errorlevel = 0
REM Insert programs to be executed only once a day here.
:END
In the above example, the name of the batch file is used as the
parameter, but it could just as easily have been a dummy file
specially for the purpose, or any other file.
Update History
--------------
Version
1.00 - 20/12/89 - Initial release.
David Foster
H.L.C. Services
High Leys
Crook
Kendal
Cumbria
LA8 8LF
END